//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#ifndef POLICYMANAGER_H_
#define POLICYMANAGER_H_

#include "INETDefs.h"

#include "InetSimpleBattery.h"
#include "Ieee80211Mac.h"
#include "Ieee80211MgmtBase.h"
#include "Emulate3G.h"

#include "PersonalStatusUpdate_m.h"

class INET_API PolicyManager : public cSimpleModule
{
public:
    PolicyManager();
    virtual ~PolicyManager();

protected:
  virtual int numInitStages() const {return 1;}
  virtual void initialize(int stage);
  virtual void handleMessage(cMessage *msg);
  virtual void finish();

  virtual void handleSelfMsg(cMessage *msg);
  virtual void handleBrainMsg(cMessage *msg);

private:
  void updateMsg(void);

protected:
  /** @name gate from brain */
  /*@{*/
  int brainIn;
  /*@}*/

  /** @name gate to brain */
  /*@{*/
  int brainOut;
  /*@}*/

private:

  // Update Interval variables
  simtime_t updateIntervalTime;
  cMessage *msgUpdate;

  //stats
  cMessage *msgStat;
  cOutVector *wifiQueue;
  cOutVector *cellQueue;
  cOutVector *energyFactor;
  double last_wifi_factor;
  double last_cell_factor;
  double last_energy_factor;
};

#endif /* POLICYMANAGER_H_ */
